package com.uottawa.clickerapp.controller;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.uottawa.clickerapp.domain.Question;
import com.uottawa.clickerapp.service.ClickerAppService;


/**
 * Controller class to handle Rest requests for the clickerApp
 * @author uOttawa
 *
 */
@Controller
public class ClickerAppController {
	
	@Resource(name="clickerAppService")
	private ClickerAppService clickerAppService;
	
	@RequestMapping(value="/openquestions/{sessionId}", method = RequestMethod.GET)
	@ResponseBody
	public List<Question> getOpenQuestions(@PathVariable Long sessionId) {
		
		// List<Question> questions = clickerAppService.getOpenQuestions(sessionId);
		
		List<Question> questions = new ArrayList<Question>();
		/*
		Question question1 = new Question();
		question1.setQuestionId(111111L);
		question1.setSessionId(00001L);
		question1.setQuestionType("true/False");
		question1.setQuestionText("Do you like coding?");
		
		questions.add(question1);
		
		Question question2 = new Question();
		question2.setQuestionId(22222L);
		question2.setSessionId(00001L);
		question2.setQuestionType("true/False");
		question2.setQuestionText("Do you like Mobile development?");
		
		questions.add(question2);
		*/
		return questions;

	}
	
}